﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;

namespace MallProject.Model
{
    public class User
    {
        public int Id { get; set; }
        public string Username { get; set; }
        public string Password { get; set; }
        public string Fullname { get; set; }
        public DateTime Birthday { get; set; }
        public string Address { get; set; }
        public string Email { get; set; }
        public string Phone { get; set; }
        public string Yahoo { get; set; }
        public string Skype { get; set; }
        public int GroupID { get; set; }
        public DateTime CreatedDate { get; set; }
        public DateTime ModifiedDate { get; set; }
        public int Status { get; set; }
        public User()
        {

        }
        public User(DataRow dr)
        {
            this.Id = Convert.ToInt32(dr["id"].ToString());
            this.Username = dr["username"].ToString();
            this.Password = dr["password"].ToString();
            this.Fullname = dr["fullname"].ToString();
            this.Birthday = Convert.ToDateTime(dr["birthday"].ToString());
            this.Address = dr["address"].ToString();
            this.Email = dr["email"].ToString();
            this.Phone = dr["phone"].ToString();
            this.Yahoo = dr["yahoo"].ToString();
            this.Skype = dr["skype"].ToString();
            this.GroupID = Convert.ToInt32(dr["group_id"].ToString());
            this.CreatedDate = Convert.ToDateTime(dr["created_date"].ToString());
            this.ModifiedDate = Convert.ToDateTime(dr["modified_date"].ToString());
            this.Status = Convert.ToInt32(dr["status"].ToString());
        }
    }
}